﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YXShop.IDAL.Accessories;
using YXShop.DALFactory;

namespace YXShop.BLL.Accessories
{
    public class Question
    {
        private readonly IQuestion dal = DataAccess.CreateQuestList();

        #region "Database Operation"
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Add(YXShop.Model.Accessories.Question model)
        {
            return dal.Add(model);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="model"></param>
        public void Update(YXShop.Model.Accessories.Question model)
        {
            dal.Update(model);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        public void Delete(int id)
        {
            dal.Delete(id);
        }
          /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="ids"></param>
        public void DeleteAll(string ids)
        {
            dal.DeleteAll(ids);
        }
        #endregion

        #region "Data load"
         /// <summary>
        /// 根据ID返回对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public YXShop.Model.Accessories.Question GetModelById(int id)
        {
            return dal.GetModelById(id);
        }
        /// <summary>
        /// 得到指定条件的列表
        /// </summary>
        /// <param name="uid"></param>
        /// <returns></returns>
        public List<YXShop.Model.Accessories.Question> GetAll(string strWhere)
        {
            return dal.GetAll(strWhere);
        }
        /// <summary>
        /// 分页
        /// </summary>
        /// <returns></returns>
        public ChangeHope.DataBase.DataByPage GetList(int questID)
        {
            return dal.GetList(questID);
        }
        #endregion
    }
}
